﻿Imports System.Xml.Serialization

Namespace KofaxXmlSchema

    <System.Xml.Serialization.XmlRoot()> Public Class ImportSession
        <System.Xml.Serialization.XmlAttribute("UserID")> Public UserID As String
        <System.Xml.Serialization.XmlAttribute("Password")> Public Password As String
        <System.Xml.Serialization.XmlArray("Batches")> Public Batches() As Batch
        <System.Xml.Serialization.XmlElement("DeleteBatchOnError")> Public DeleteBatchOnError As Boolean
        <System.Xml.Serialization.XmlElement("LogFileName")> Public LogFileName As String
        <System.Xml.Serialization.XmlElement("LastErrorCode")> Public LastErrorCode As Integer
        <System.Xml.Serialization.XmlElement("LastErrorMessage")> Public LastErrorMessage As String

        Public Class Batch
            <System.Xml.Serialization.XmlAttribute("Name")> Public Name As String
            <System.Xml.Serialization.XmlAttribute("ExternalBatchID")> Public ExternalBatchID As String
            <System.Xml.Serialization.XmlAttribute("BatchClassName")> Public BatchClassName As String
            <System.Xml.Serialization.XmlAttribute("Description")> Public Description As String
            <System.Xml.Serialization.XmlAttribute("Priority")> Public Priority As Integer
            <System.Xml.Serialization.XmlAttribute("EnableAutomaticSeparationAndFormID")> Public EnableAutomaticSeparationAndFormID As Boolean
            <System.Xml.Serialization.XmlAttribute("EnableSingleDocBatchProcessing")> Public EnableSingleDocBatchProcessing As Boolean
            <System.Xml.Serialization.XmlAttribute("RelativeImageFilePath")> Public RelativeImageFilePath As String
            <System.Xml.Serialization.XmlAttribute("Processed")> Public Processed As Boolean
            <System.Xml.Serialization.XmlAttribute("PagesScanned")> Public PagesScanned As Integer
            <System.Xml.Serialization.XmlAttribute("CreationDateTime")> Public CreationDateTime As String
            <System.Xml.Serialization.XmlArray("BatchHistoryEntries")> Public BatchHistoryEntries() As BatchHistoryEntry
            <System.Xml.Serialization.XmlArray("BatchCustomProperties")> Public BatchCustomProperties() As BatchCustomProperty
            <System.Xml.Serialization.XmlArray("BatchClassCustomStorageStrings")> Public BatchClassCustomStorageStrings() As BatchClassCustomStorageString
            <System.Xml.Serialization.XmlArray("BatchFields")> Public BatchFields() As BatchField
            <System.Xml.Serialization.XmlArray("Folders")> Public Folders() As Folder
            <System.Xml.Serialization.XmlArray("Documents")> Public Documents() As Document
            <System.Xml.Serialization.XmlArray("Pages")> Public Pages() As Page

            Public Class BatchField
                <System.Xml.Serialization.XmlAttribute("Name")> Public Name As String
                <System.Xml.Serialization.XmlAttribute("Value")> Public Value As String
            End Class

            Public Class BatchCustomProperty
                Public Name As String
                Public RelSetupID As Integer
                Public Value As String
                Public FilterID As Integer
            End Class

            Public Class BatchHistoryEntry
                Public ModuleID As String
                Public ErrorCode As Integer
                Public State As Integer
                Public UserID As String
                Public StationID As String
                Public StartDateTime As DateTime
                Public EndDateTime As DateTime
                Public ErrorText As String
                Public ManualKeyStrokes As Integer
                Public OcrKeyStrokes As Integer
                Public IcrKeyStrokes As Integer
                Public OmrKeyStrokes As Integer
                Public BarKeyStrokes As Integer
            End Class

            Public Class BatchClassCustomStorageString
                Public Name As String
                Public Value As String
            End Class

        End Class

    End Class

    Public Class Folder
        <System.Xml.Serialization.XmlElementAttribute("FolderClassName")> Public FolderClassName As String
        <System.Xml.Serialization.XmlArray("Documents")> Public Documents() As Document
        <System.Xml.Serialization.XmlArray("IndexFields")> Public IndexFields() As IndexField
    End Class

    Public Class Document
        <System.Xml.Serialization.XmlAttribute("FormTypeName")> Public FormTypeName As String
        <System.Xml.Serialization.XmlAttribute("BatchDocGUID")> Public BatchDocGUID As String
        <System.Xml.Serialization.XmlAttribute("Confidence")> Public Confidence As String
        <System.Xml.Serialization.XmlAttribute("OcrConvertedFileName")> Public OcrConvertedFileName As String
        <System.Xml.Serialization.XmlArray("Pages")> Public Pages() As Page
        <System.Xml.Serialization.XmlArray("Tables")> Public Tables() As Table
        <System.Xml.Serialization.XmlArray("IndexFields")> Public IndexFields() As IndexField
        <System.Xml.Serialization.XmlArray("DocumentProperties")> Public DocumentProperties() As DocumentProperty
        <System.Xml.Serialization.XmlArray("DocumentCustomStorageStrings")> Public DocumentCustomStorageStrings() As DocumentCustomStorageString

        Public Class Table
            <System.Xml.Serialization.XmlElement("Name")> Public Name As String
            <System.Xml.Serialization.XmlArray("TableRows")> Public TableRows() As TableRow
        End Class

        Public Class TableRow
            <System.Xml.Serialization.XmlArray("IndexFields")> Public IndexFields() As IndexField
        End Class

        Public Class DocumentProperty
            Public Name As String
            Public BatchID As String
            Public ModuleID As String
            Public Value As String
        End Class

        Public Class DocumentCustomStorageString
            Public Name As String
            Public Value As String
        End Class

    End Class

    Public Class Page
        <System.Xml.Serialization.XmlAttribute("ImageID")> Public ImageID As String
        <System.Xml.Serialization.XmlAttribute("ImportFileName")> Public ImportFileName As String
        <System.Xml.Serialization.XmlAttribute("ImageFile")> Public ImageFile As Byte()
        <System.Xml.Serialization.XmlAttribute("OriginalFileName")> Public OriginalFileName As String
        <System.Xml.Serialization.XmlAttribute("PageRegConfidence")> Public PageRegConfidence As String
        <System.Xml.Serialization.XmlElementAttribute("PageText")> Public PageText As String
        <System.Xml.Serialization.XmlArray("PageCustomStorageString")> Public PageCustomStorageStrings() As PageCustomStorageString

        Public Class PageCustomStorageString
            Public Name As String
            Public Value As String
        End Class

    End Class

    Public Class IndexField
        <System.Xml.Serialization.XmlElement("Name")> Public Name As String
        <System.Xml.Serialization.XmlElement("Value")> Public Value As String
    End Class

End Namespace
